/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.tnmk.worktime.service.filter;

import org.tnmk.common.util.Filter;
import org.joda.time.DateTime;
import org.tnmk.worktime.utils.TimePeriodUtils;

/**
 *
 * @author tnmkhoi
 */
public final class ThisMonthTimeFilter implements Filter<DateTime> {
  private static final ThisMonthTimeFilter INSTANCE = new ThisMonthTimeFilter();
  private ThisMonthTimeFilter() {}
  public static ThisMonthTimeFilter getInstance() {
    return INSTANCE;
  }

  public boolean accept(DateTime model) {
    boolean rs = false;
    if (model == null) {
      return rs;
    }
    rs = TimePeriodUtils.isInThisMonth(model);
    return rs;
  }
}
